//
//  HMPictureViewCell.m
//  OC新浪微博
//
//  Created by wyman on 16/4/19.
//  Copyright © 2016年 wyman. All rights reserved.
//

#import "HMPictureViewCell.h"
#import <Masonry.h>
#import <UIImageView+WebCache.h>
@interface HMPictureViewCell()
@property (nonatomic, strong) UIImageView *image;
@end
@implementation HMPictureViewCell


-(void)setImageUrl:(NSURL *)imageUrl{
    _imageUrl = imageUrl;
    
//    if (imageUrl==nil) {
//        return;
//    }
    [self.image sd_setImageWithURL:imageUrl];

    

}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self prepareUI];
    }

    return self;
}

-(void)prepareUI
{
//创建图片
    
   
    self.image = [[UIImageView alloc]init];
    self.image.contentMode = UIViewContentModeScaleToFill;

    self.image.clipsToBounds = true;
    [self addSubview:self.image];
    [self.image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.contentView);
    }];
    
    
}
@end
